package com.dch.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dch.entity.Account;
import com.dch.mapper.AccountMapper;
import com.dch.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountMapper accountMapper;

    @Override
    public Account findByUsername(String username) {

        QueryWrapper<Account> queryWrapper = new QueryWrapper ();
        queryWrapper.lambda().eq(Account::getUserName, username);
        return this.accountMapper.selectOne(queryWrapper);
    }
}
